/*
 * This file is part of Ember.
 *
 * Ember is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * Ember is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with Ember.  If not, see <http://www.gnu.org/licenses/>.
 *
 * Copyright (C) Grant Tyra 2010
 * granttyra@gmail.com
*/

#ifndef EMBER_OBJECT_H_
#define EMBER_OBJECT_H_

#include "ember_config.h"
#include "ember_class.h"

#define TYPE_INTEGER 1
#define TYPE_DECIMAL 2
#define TYPE_STRING 4
#define TYPE_COMPLEX 8
#define TYPE_LIST 16
#define TYPE_DICT 32
#define TYPE_EXCEPTION 64

typedef struct object_s {
    EmberClassDef *classdef;
    EmberDictionary *attributes;
	int typeFlags;
    int refCount;
} EmberObject;

EMBER_EXPORT void EmberObjectRetain(EmberObject*);
EMBER_EXPORT void EmberObjectRelease(EmberObject*);

EMBER_EXPORT EmberObject *EmberObjectCreate(const char*);
EMBER_EXPORT EmberObject *EmberObjectCreateException(const char*);

EMBER_EXPORT void *EmberObjectGetAttribute(EmberObject*, const char*);
EMBER_EXPORT void EmberObjectPutAttribute(EmberObject*, const char*, void*);

EMBER_EXPORT void EmberObjectDestroy(EmberObject*);

#endif
